home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-07-03 | 3.2 KB | 111 lines | [TEXT/R*ch] |
- (* General -- SML Standard Library *)
-
- eqtype char
- type exn
- eqtype int
- eqtype real
- eqtype string
- eqtype unit
-
- datatype bool = false | true
- datatype 'a list = nil | op :: of 'a * 'a list
- datatype 'a option = NONE | SOME of 'a
- datatype ordering = LESS | EQUAL | GREATER
- datatype '_a ref = ref of '_a
-
- exception Bind
- exception Match
- exception Interrupt
-
- exception Subscript
- exception Size
- exception Fail of string
-
- exception Overflow
- exception Div
- exception Sqrt
- exception Ln
- exception Trig
-
- val exnName : exn -> string
- val exnMessage : exn -> string
-
- exception Option
- val getOpt : 'a option * 'a -> 'a
- val isSome : 'a option -> bool
- val valOf : 'a option -> 'a
-
- val not : bool -> bool
-
- (* Below, cirs is char, int, string, or real: *)
- val < : cirs * cirs -> bool
- val <= : cirs * cirs -> bool
- val > : cirs * cirs -> bool
- val >= : cirs * cirs -> bool
- val = : ''a * ''a -> bool
- val <> : ''a * ''a -> bool
-
- (* Below, num is int or real: *)
- val ~ : num -> num (* raises Overflow *)
- val + : num * num -> num (* raises Overflow *)
- val - : num * num -> num (* raises Overflow *)
- val * : num * num -> num (* raises Overflow *)
- val / : real * real -> real (* raises Div, Overflow *)
- val div : int * int -> int (* raises Div, Overflow *)
- val mod : int * int -> int (* raises Div *)
- val quot : int * int -> int
- val rem : int * int -> int (* raises Div *)
-
- val floor : real -> int (* raises Overflow *)
- val real : int -> real
-
- val sqrt : real -> real (* raises Sqrt *)
- val ln : real -> real (* raises Ln *)
- val exp : real -> real (* raises Overflow *)
- val sin : real -> real (* raises Fail *)
- val cos : real -> real (* raises Fail *)
- val arctan : real -> real
-
- val size : string -> int
- val ^ : string * string -> string (* raises Size *)
-
- val o : ('b -> 'c) * ('a -> 'b) -> ('a -> 'c)
- val ignore : 'a -> unit
- val before : 'a * unit -> 'a
-
- val ! : 'a ref -> 'a
- val := : 'a ref * 'a -> unit
-
- (* Non-standard types and exceptions *)
-
- datatype 'a frag = QUOTE of string | ANTIQUOTE of 'a
-
- exception Io of string
- exception Graphic_failure of string
- exception Out_of_memory
-
- (*
-
- [exnName exn] returns the name of the exception constructor in exn,
- if possible; otherwise returns the string "<unknown>". Works at
- least for the exceptions defined by the SML Standard Library.
- Never raises an exception itself. The name returned may be that of
- any exception constructor aliasing with exn. For instance,
- (exception E1; exception E2 = E1; exnName E2)
- may evaluate to "E1" or "E2".
-
- [exnMessage exn] formats and returns a message corresponding to
- exception exn, if possible; otherwise returns the string "Uncaught
- exception: <unknown>". Works at least for the exceptions defined
- by the SML Standard Library. Never raises an exception itself.
- The name returned may be that name of any exception aliasing with
- exn.
-
- [getOpt(opt, a)] returns v if opt is SOME v; otherwise returns a.
-
- [isSome opt] returns true if opt is SOME v; otherwise returns false.
-
- [valOf opt] returns v if opt is SOME v; otherwise raises Option.
-
- *)
-